<?php
/**
 * Created by PhpStorm.
 * User: jungshen
 * Date: 2019/4/26
 * Time: 11:40
 */

namespace app\xueao\validate;


use think\Validate;

class Member extends Validate
{
    protected $rule = [
        'phone|手机号'  =>  'mobile',
    ];

    /**
     * 成为经销商
     * @return $this
     */
    function sceneBecomesupplier(){
        return $this->append('name|名称', 'require')
            ->append('point|积分', 'integer');
    }

    /**
     * 改变积分
     * @return $this
     */
    function sceneChangepoint(){
        return $this->append('point|积分', 'require|integer');
    }

    /**
     * 经销商改变用户的积分
     * @return $this
     */
    function sceneChangepointsupplier(){
        return $this->append('point|积分', 'require|integer|gt:0')
            ->append('id|会员','require|integer');
    }
}